home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 44 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.std.c
  4. Subject: Re: Alignment of malloc()
  5. Date: Sat, 06 Jan 96 18:57:31 GMT
  6. Organization: none
  7. Message-ID: <820954651snz@genesis.demon.co.uk>
  8. References: <DKDA7D.Kw7@midway.uchicago.edu> <j66Sx*FRe@yaps.rhein.de> <DKKHCH.L6r@midway.uchicago.edu>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <DKKHCH.L6r@midway.uchicago.edu>
  15.            mps@geodesic.com "Michael Spertu" writes:
  16.  
  17. >For this reason, the two possibilities are:
  18. >
  19. >1) All the texts (including K & R) are advocating code that is not reasonable
  20. >on (the most common) compliant implementations of C.
  21.  
  22. It is not the responsibility of C language texts to pay lip-service to a
  23. particular implmentation (otherwise we'd all be using near+far pointers,
  24. inline assembly etc). Rather it is up to the implementation to
  25.  
  26. a) conform to the language specs., which is objective
  27.  
  28. b) provide a reasonable 'quality' (including features, performance etc.) a
  29.    great deal of which is subjective. If you have a poorly performing
  30.    implementation, the implementation needs to be fixed, not the language
  31.    or the textbooks. An inefficient implementation of printf is (or can be)
  32.    still conforming. You don't go and change all the textbooks just because
  33.    an implementor was lazy.
  34.  
  35. >2) 32 bit alignment of malloc() on PCs is not compliant.
  36.  
  37. It always has been and still is.
  38.  
  39. >Either possibility is very serious, and violates assumptions that most 
  40. >programmers take for granted
  41.  
  42. It is the implementation that violated the programmer's assumptions. This
  43. has nothing to do with the C standard or C language textbooks. It may
  44. have some relevance to PC/Windows programming textbooks.
  45.  
  46. -- 
  47. -----------------------------------------
  48. Lawrence Kirby | fred@genesis.demon.co.uk
  49. Wilts, England | 70734.126@compuserve.com
  50. -----------------------------------------
  51.